package com.cjx.stars.utils;

import com.cjx.stars.pojo.vo.UserVo;

public class UserHolder {
    private static final ThreadLocal<UserVo> THREAD_LOCAL = new ThreadLocal<>();

    public static void saveUser(UserVo user){
        THREAD_LOCAL.set(user);
    }

    public static UserVo getUser(){
        return THREAD_LOCAL.get();
    }

    public static void removeUser(){
        THREAD_LOCAL.remove();
    }
}
